-- damage
-- create by weism
-- 攻击受创（技能规则）

return {
    apply = function(source, target, skillId, round, para, extra)
        -- 消耗掉全部魔法值
        local mp = source:queryAttrib("mp");
        if mp > 0 then
            source:costAttrib("mp", mp);
        end
        -- 保底1点伤害
        local damage = math.max(math.modf(mp * para[1] / 1000), 1);

        -- 增加命中动作
        SkillM.getSequence(target):hit(source, target, skillId);

        -- 伤害
        CombatM.doDamage(source, target, damage, skillId, nil, extra);

        -- 作用目标
        return { target, };
    end,

    parse = function(desc)
        local arr = string.explode(desc, ",");
        return { tonumber(arr[1]), };
    end,

    -- 解析技能描述
    parseDesc = function(source, skillId, desc, para)
        return desc;
    end,
};
